package com.huage_06.lesson_03;

import java.util.HashSet;

public class HashSetTest {
    public static void main(String[] args) {
        HashSet<Student> set = new HashSet<Student>();

       Student std1 = new Student("张三",23);
       Student std2 = new Student("李四",24);
       Student std3 = new Student("王五",25);
       Student std4 = new Student("王五",25);

       set.add(std1);
       set.add(std2);
       set.add(std3);
       set.add(std4);

       for (Student s : set){
           System.out.println(s.getName()+","+s.getAge());
       }
    }
}
